<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../iquery/jquery-3.6.1.min.js"></script>
     <!-- 遍历checkbox控件，输出选中个数 --> 
     <input type="checkbox" value="1" name="check" checked="checked" />
     <input type="checkbox" value="2" name="check"  />
     <input type="checkbox" value="3" name="check" checked="checked" />
     <input type="checkbox" value="4" name="check"   />
    <p></p>


</head>
<body>
   

    <script type="text/javascript">
    //    $("input").click(function(){
    //         var inputArr = $(":checked");
    //         $("p").text("选中的个数="+inputArr.length)
    //      })
       
        
    </script>
</body>
</html>